package com.minisoft.utils;

import cn.hutool.core.lang.Console;
import cn.hutool.crypto.digest.DigestUtil;

public class Constants {

    // 用于openid做md5加密
    public static final String KEY = "ewqjrkl79234fasdfasdfwe23423";

    /**
     * 根据openid获取passport
     * @param openid
     * @return
     */
    public static String getPassport(String openid) {
        return DigestUtil.md5Hex(openid + Constants.KEY);
    }

    public static void main(String[] args) {
        String openid = "oDyJbxI3qgBhM1pC_bx1LV91xqHA";
        Console.log("\"openid\":\"{}\",\"passport\":\"{}\"",openid,getPassport(openid));
    }
}
